package homework20.com.neuedu.dao;

public class GameDaoImpl {

    String a[] = new String[10];

    public void addGoods(String name) {
        int i ;
        for (i = 0; i < a.length; i++) {
            if (a[i] == null)
                break;
        }
        a[i] = name;
        System.out.println("添加物品成功");
    }

    public void updateGoods(int A, String name) {
        a[A-1] = name;
        System.out.println("修改物品成功");
    }

    public void deleteGoods(int A) {
        a[A-1] = null;
        System.out.println("删除物品成功");
    }

    public int findGoodsS() {
        for (int i = 0; i < a.length; i++) {
            if (a[i] != null)
                System.out.println("物品" + (i + 1) + ":" + a[i]);
        }
        return -1;
    }
}
